/**$Licence:
 *   Use this however/wherever you like, just don't blame me if it breaks anything.
 *   Copyright (C) 2008 - 2013 xingsheng.zhu@gmail.com All rights reserved.
 */
package com.blazemina.exception;


import com.blazegame.logging.Logger;
import com.blazegame.logging.LoggerFactory;

/**
 * @author JackChu
 * @version 1.0.0 2013-2-25 下午7:28:11
 */
public class DefaultExceptionMonitor extends ExceptionMonitor {
    private final static Logger LOGGER = LoggerFactory.getLogger(DefaultExceptionMonitor.class);

    /**
     * {@inheritDoc}
     */
    @Override
    public void exceptionCaught(Throwable cause) {
        if (cause instanceof Error) {
            throw (Error) cause;
        }

        LOGGER.warn("Unexpected exception.", cause);
    }
}